package edu.ncsu.csc.ip.client;

/**
 * Similar to a Bean but contains pertaniant information about a client. It also
 * has getters for this information.
 * 
 * 
 * 
 * @author Moin Ayazifar <mayazif@ncsu.edu>
 * @author Steven Elliott <sdelliot@ncsu.edu>
 * 
 */

public class ClientInfo {

	private Integer cookie;

	private Integer rfcServerPort;

	private String localAddress;

	private String localHostName;

	private String rsServerAddress;

	private String rsPort;

	private String rfcBundleFolder;

	/**
	 * @return the cookie
	 */
	public Integer getCookie() {
		return cookie;
	}

	/**
	 * @param cookie
	 *            the cookie to set
	 */
	public void setCookie(Integer cookie) {
		this.cookie = cookie;
	}

	/**
	 * @return the rfcPort
	 */
	public Integer getRfcServerPort() {
		return rfcServerPort;
	}

	/**
	 * @param rfcPort
	 *            the rfcPort to set
	 */
	public void setRfcServerPort(Integer rfcServerPort) {
		this.rfcServerPort = rfcServerPort;
	}

	public String getLocalAddress() {
		return localAddress;
	}

	public void setLocalAddress(String localAddress) {
		this.localAddress = localAddress;
	}

	public String getLocalHostName() {
		return localHostName;
	}

	public void setLocalHostName(String localHostName) {
		this.localHostName = localHostName;
	}

	public String getRfcBundleFolder() {
		return rfcBundleFolder;
	}

	public void setRfcBundleFolder(String rfcBundleFolder) {
		if (rfcBundleFolder.endsWith("/"))
			this.rfcBundleFolder = rfcBundleFolder;
		else
			this.rfcBundleFolder = rfcBundleFolder + "/";
	}

	public String getRsServerAddress() {
		return rsServerAddress;
	}

	public void setRsServerAddress(String rsServerAddress) {
		this.rsServerAddress = rsServerAddress;
	}

	public String getRsPort() {
		return rsPort;
	}

	public void setRsPort(String rsPort) {
		this.rsPort = rsPort;
	}

	@Override
	public String toString() {
		return "[Client #" + (getCookie() == null ? "?" : getCookie()) + " ("
				+ getLocalAddress() + ":" + getRfcServerPort() + ")]: ";
	}
}
